package com.app.common.dataDictionary.PO;

import java.util.*;
import com.css.sword.kernel.base.annotation.*;
import com.css.sword.kernel.base.dataElement.*;
import com.css.sword.kernel.base.exception.SwordBaseCheckedException;

import com.app.common.dataDictionary.DE.DE_USERPRIZE_ID;
import com.app.common.dataDictionary.DE.DE_W_PRIZE_ID;
import com.app.common.dataDictionary.DE.DE_USERID;
import com.app.common.dataDictionary.DE.DE_USERPRIZE_TITLE;
import com.app.common.dataDictionary.DE.DE_USERPRIZE_EXPIRYDATE;
import com.app.common.dataDictionary.DE.DE_USERPRIZE_NEEDWEALTH;
import com.app.common.dataDictionary.DE.DE_USERPRIZE_IMGID;
import com.app.common.dataDictionary.DE.DE_USERPRIZE_IMGNAME;
import com.app.common.dataDictionary.DE.DE_USERPRIZE_IMGDOMAIN;
import com.app.common.dataDictionary.DE.DE_USERPRIZE_IMGPATH;
import com.app.common.dataDictionary.DE.DE_USERPRIZE_IMGSIZE;
import com.app.common.dataDictionary.DE.DE_USERPRIZE_DUIHUANTIME;
import com.app.common.dataDictionary.DE.DE_USERPRIZE_OPPTIME;
import com.app.common.dataDictionary.DE.DE_USERPRIZE_CATEGORY;
import com.app.common.dataDictionary.DE.DE_USERPRIZE_SFUSED;
import com.app.common.dataDictionary.DE.DE_USERPRIZE_DETAIL;


/**
 * 用户奖品表; InnoDB free: 10240 kB
 */
@PersistObject
public class TUserPrizePO extends AbsPersistObject {
	//private static final long serialVersionUID = 3993076942237991316L;
	private static final long serialVersionUID = 1L;
	private static final Map<String, Integer> fieldIndex = new HashMap<String, Integer>(16);
	private static final BitSet HAS_DEFAULT_VALUE = new BitSet(16);
	
	static{
		fieldIndex.put("userprizeId",0);fieldIndex.put("wPrizeId",1);fieldIndex.put("userid",2);fieldIndex.put("userprizeTitle",3);fieldIndex.put("userprizeExpirydate",4);fieldIndex.put("userprizeNeedwealth",5);fieldIndex.put("userprizeImgid",6);fieldIndex.put("userprizeImgname",7);fieldIndex.put("userprizeImgdomain",8);fieldIndex.put("userprizeImgpath",9);fieldIndex.put("userprizeImgsize",10);fieldIndex.put("userprizeDuihuantime",11);fieldIndex.put("userprizeOpptime",12);fieldIndex.put("userprizeCategory",13);fieldIndex.put("userprizeSfused",14);fieldIndex.put("userprizeDetail",15);
	}
	
	/**
	 * 物理表名
	 */
	public static final String TABLE_NAME = "t_user_prize";

	/**
	 * 主键id
	 */
	private DE_USERPRIZE_ID userprizeId = DE_USERPRIZE_ID.getTemplateInstance();

	/**
	 * 财富奖区奖品id
	 */
	private DE_W_PRIZE_ID wPrizeId = DE_W_PRIZE_ID.getTemplateInstance();

	/**
	 * 用户id
	 */
	private DE_USERID userid = DE_USERID.getTemplateInstance();

	/**
	 * 用户奖品title
	 */
	private DE_USERPRIZE_TITLE userprizeTitle = DE_USERPRIZE_TITLE.getTemplateInstance();

	/**
	 * 用户奖品有效时间天数
	 */
	private DE_USERPRIZE_EXPIRYDATE userprizeExpirydate = DE_USERPRIZE_EXPIRYDATE.getTemplateInstance();

	/**
	 * 用户奖品所需财富值
	 */
	private DE_USERPRIZE_NEEDWEALTH userprizeNeedwealth = DE_USERPRIZE_NEEDWEALTH.getTemplateInstance();

	/**
	 * 用户奖品图片编号
	 */
	private DE_USERPRIZE_IMGID userprizeImgid = DE_USERPRIZE_IMGID.getTemplateInstance();

	/**
	 * 用户奖品图片name
	 */
	private DE_USERPRIZE_IMGNAME userprizeImgname = DE_USERPRIZE_IMGNAME.getTemplateInstance();

	/**
	 * 用户奖品图片主路径
	 */
	private DE_USERPRIZE_IMGDOMAIN userprizeImgdomain = DE_USERPRIZE_IMGDOMAIN.getTemplateInstance();

	/**
	 * 用户奖品图片文件路径
	 */
	private DE_USERPRIZE_IMGPATH userprizeImgpath = DE_USERPRIZE_IMGPATH.getTemplateInstance();

	/**
	 * 用户奖品图片大小
	 */
	private DE_USERPRIZE_IMGSIZE userprizeImgsize = DE_USERPRIZE_IMGSIZE.getTemplateInstance();

	/**
	 * 我的奖品兑换时间
	 */
	private DE_USERPRIZE_DUIHUANTIME userprizeDuihuantime = DE_USERPRIZE_DUIHUANTIME.getTemplateInstance();

	/**
	 * 最后一次操作时间
	 */
	private DE_USERPRIZE_OPPTIME userprizeOpptime = DE_USERPRIZE_OPPTIME.getTemplateInstance();

	/**
	 * 用户奖品类别
	 */
	private DE_USERPRIZE_CATEGORY userprizeCategory = DE_USERPRIZE_CATEGORY.getTemplateInstance();

	/**
	 * 用户奖品是否使用过
	 */
	private DE_USERPRIZE_SFUSED userprizeSfused = DE_USERPRIZE_SFUSED.getTemplateInstance();

	/**
	 * 用户奖品说明
	 */
	private DE_USERPRIZE_DETAIL userprizeDetail = DE_USERPRIZE_DETAIL.getTemplateInstance();


	public TUserPrizePO(){
		this.insertState = new BitSet(16);
		this.updateState = new BitSet(16);
	}

	
	/**
	 * 获取 "主键id" 值
	 */	
	public DE_USERPRIZE_ID getUserprizeId(){
		return  userprizeId;
	}
	
	/**
	 * 设置 "主键id" 值
	 */
	public void setUserprizeId(DE_USERPRIZE_ID userprizeId) {
		if(userprizeId == null){
			userprizeId= DE_USERPRIZE_ID.getTemplateInstance();
		}
		recordChangeFlag(0);
		this.userprizeId = userprizeId;
	}
	
	/**
	 * 获取 "财富奖区奖品id" 值
	 */	
	public DE_W_PRIZE_ID getWPrizeId(){
		return  wPrizeId;
	}
	
	/**
	 * 设置 "财富奖区奖品id" 值
	 */
	public void setWPrizeId(DE_W_PRIZE_ID wPrizeId) {
		if(wPrizeId == null){
			wPrizeId= DE_W_PRIZE_ID.getTemplateInstance();
		}
		recordChangeFlag(1);
		this.wPrizeId = wPrizeId;
	}
	
	/**
	 * 获取 "用户id" 值
	 */	
	public DE_USERID getUserid(){
		return  userid;
	}
	
	/**
	 * 设置 "用户id" 值
	 */
	public void setUserid(DE_USERID userid) {
		if(userid == null){
			userid= DE_USERID.getTemplateInstance();
		}
		recordChangeFlag(2);
		this.userid = userid;
	}
	
	/**
	 * 获取 "用户奖品title" 值
	 */	
	public DE_USERPRIZE_TITLE getUserprizeTitle(){
		return  userprizeTitle;
	}
	
	/**
	 * 设置 "用户奖品title" 值
	 */
	public void setUserprizeTitle(DE_USERPRIZE_TITLE userprizeTitle) {
		if(userprizeTitle == null){
			userprizeTitle= DE_USERPRIZE_TITLE.getTemplateInstance();
		}
		recordChangeFlag(3);
		this.userprizeTitle = userprizeTitle;
	}
	
	/**
	 * 获取 "用户奖品有效时间天数" 值
	 */	
	public DE_USERPRIZE_EXPIRYDATE getUserprizeExpirydate(){
		return  userprizeExpirydate;
	}
	
	/**
	 * 设置 "用户奖品有效时间天数" 值
	 */
	public void setUserprizeExpirydate(DE_USERPRIZE_EXPIRYDATE userprizeExpirydate) {
		if(userprizeExpirydate == null){
			userprizeExpirydate= DE_USERPRIZE_EXPIRYDATE.getTemplateInstance();
		}
		recordChangeFlag(4);
		this.userprizeExpirydate = userprizeExpirydate;
	}
	
	/**
	 * 获取 "用户奖品所需财富值" 值
	 */	
	public DE_USERPRIZE_NEEDWEALTH getUserprizeNeedwealth(){
		return  userprizeNeedwealth;
	}
	
	/**
	 * 设置 "用户奖品所需财富值" 值
	 */
	public void setUserprizeNeedwealth(DE_USERPRIZE_NEEDWEALTH userprizeNeedwealth) {
		if(userprizeNeedwealth == null){
			userprizeNeedwealth= DE_USERPRIZE_NEEDWEALTH.getTemplateInstance();
		}
		recordChangeFlag(5);
		this.userprizeNeedwealth = userprizeNeedwealth;
	}
	
	/**
	 * 获取 "用户奖品图片编号" 值
	 */	
	public DE_USERPRIZE_IMGID getUserprizeImgid(){
		return  userprizeImgid;
	}
	
	/**
	 * 设置 "用户奖品图片编号" 值
	 */
	public void setUserprizeImgid(DE_USERPRIZE_IMGID userprizeImgid) {
		if(userprizeImgid == null){
			userprizeImgid= DE_USERPRIZE_IMGID.getTemplateInstance();
		}
		recordChangeFlag(6);
		this.userprizeImgid = userprizeImgid;
	}
	
	/**
	 * 获取 "用户奖品图片name" 值
	 */	
	public DE_USERPRIZE_IMGNAME getUserprizeImgname(){
		return  userprizeImgname;
	}
	
	/**
	 * 设置 "用户奖品图片name" 值
	 */
	public void setUserprizeImgname(DE_USERPRIZE_IMGNAME userprizeImgname) {
		if(userprizeImgname == null){
			userprizeImgname= DE_USERPRIZE_IMGNAME.getTemplateInstance();
		}
		recordChangeFlag(7);
		this.userprizeImgname = userprizeImgname;
	}
	
	/**
	 * 获取 "用户奖品图片主路径" 值
	 */	
	public DE_USERPRIZE_IMGDOMAIN getUserprizeImgdomain(){
		return  userprizeImgdomain;
	}
	
	/**
	 * 设置 "用户奖品图片主路径" 值
	 */
	public void setUserprizeImgdomain(DE_USERPRIZE_IMGDOMAIN userprizeImgdomain) {
		if(userprizeImgdomain == null){
			userprizeImgdomain= DE_USERPRIZE_IMGDOMAIN.getTemplateInstance();
		}
		recordChangeFlag(8);
		this.userprizeImgdomain = userprizeImgdomain;
	}
	
	/**
	 * 获取 "用户奖品图片文件路径" 值
	 */	
	public DE_USERPRIZE_IMGPATH getUserprizeImgpath(){
		return  userprizeImgpath;
	}
	
	/**
	 * 设置 "用户奖品图片文件路径" 值
	 */
	public void setUserprizeImgpath(DE_USERPRIZE_IMGPATH userprizeImgpath) {
		if(userprizeImgpath == null){
			userprizeImgpath= DE_USERPRIZE_IMGPATH.getTemplateInstance();
		}
		recordChangeFlag(9);
		this.userprizeImgpath = userprizeImgpath;
	}
	
	/**
	 * 获取 "用户奖品图片大小" 值
	 */	
	public DE_USERPRIZE_IMGSIZE getUserprizeImgsize(){
		return  userprizeImgsize;
	}
	
	/**
	 * 设置 "用户奖品图片大小" 值
	 */
	public void setUserprizeImgsize(DE_USERPRIZE_IMGSIZE userprizeImgsize) {
		if(userprizeImgsize == null){
			userprizeImgsize= DE_USERPRIZE_IMGSIZE.getTemplateInstance();
		}
		recordChangeFlag(10);
		this.userprizeImgsize = userprizeImgsize;
	}
	
	/**
	 * 获取 "我的奖品兑换时间" 值
	 */	
	public DE_USERPRIZE_DUIHUANTIME getUserprizeDuihuantime(){
		return  userprizeDuihuantime;
	}
	
	/**
	 * 设置 "我的奖品兑换时间" 值
	 */
	public void setUserprizeDuihuantime(DE_USERPRIZE_DUIHUANTIME userprizeDuihuantime) {
		if(userprizeDuihuantime == null){
			userprizeDuihuantime= DE_USERPRIZE_DUIHUANTIME.getTemplateInstance();
		}
		recordChangeFlag(11);
		this.userprizeDuihuantime = userprizeDuihuantime;
	}
	
	/**
	 * 获取 "最后一次操作时间" 值
	 */	
	public DE_USERPRIZE_OPPTIME getUserprizeOpptime(){
		return  userprizeOpptime;
	}
	
	/**
	 * 设置 "最后一次操作时间" 值
	 */
	public void setUserprizeOpptime(DE_USERPRIZE_OPPTIME userprizeOpptime) {
		if(userprizeOpptime == null){
			userprizeOpptime= DE_USERPRIZE_OPPTIME.getTemplateInstance();
		}
		recordChangeFlag(12);
		this.userprizeOpptime = userprizeOpptime;
	}
	
	/**
	 * 获取 "用户奖品类别" 值
	 */	
	public DE_USERPRIZE_CATEGORY getUserprizeCategory(){
		return  userprizeCategory;
	}
	
	/**
	 * 设置 "用户奖品类别" 值
	 */
	public void setUserprizeCategory(DE_USERPRIZE_CATEGORY userprizeCategory) {
		if(userprizeCategory == null){
			userprizeCategory= DE_USERPRIZE_CATEGORY.getTemplateInstance();
		}
		recordChangeFlag(13);
		this.userprizeCategory = userprizeCategory;
	}
	
	/**
	 * 获取 "用户奖品是否使用过" 值
	 */	
	public DE_USERPRIZE_SFUSED getUserprizeSfused(){
		return  userprizeSfused;
	}
	
	/**
	 * 设置 "用户奖品是否使用过" 值
	 */
	public void setUserprizeSfused(DE_USERPRIZE_SFUSED userprizeSfused) {
		if(userprizeSfused == null){
			userprizeSfused= DE_USERPRIZE_SFUSED.getTemplateInstance();
		}
		recordChangeFlag(14);
		this.userprizeSfused = userprizeSfused;
	}
	
	/**
	 * 获取 "用户奖品说明" 值
	 */	
	public DE_USERPRIZE_DETAIL getUserprizeDetail(){
		return  userprizeDetail;
	}
	
	/**
	 * 设置 "用户奖品说明" 值
	 */
	public void setUserprizeDetail(DE_USERPRIZE_DETAIL userprizeDetail) {
		if(userprizeDetail == null){
			userprizeDetail= DE_USERPRIZE_DETAIL.getTemplateInstance();
		}
		recordChangeFlag(15);
		this.userprizeDetail = userprizeDetail;
	}


	@Override
	public BaseDataElement<?>[] fields(){
		return new BaseDataElement<?>[] {userprizeId,wPrizeId,userid,userprizeTitle,userprizeExpirydate,userprizeNeedwealth,userprizeImgid,userprizeImgname,userprizeImgdomain,userprizeImgpath,userprizeImgsize,userprizeDuihuantime,userprizeOpptime,userprizeCategory,userprizeSfused,userprizeDetail};
	}
	
	@Override
	public String[] fieldNames() {
		return new String[]{"userprizeId","wPrizeId","userid","userprizeTitle","userprizeExpirydate","userprizeNeedwealth","userprizeImgid","userprizeImgname","userprizeImgdomain","userprizeImgpath","userprizeImgsize","userprizeDuihuantime","userprizeOpptime","userprizeCategory","userprizeSfused","userprizeDetail"};
	}
	
	@Override
	public BaseDataElement<?> getFieldValue(String fieldName)  {
		final Integer index = fieldIndex.get(fieldName);
		if (index == null) {
			throw new IllegalArgumentException("PO对象中没有" + fieldName + "字段");
		}
		switch (index) {
		case 0 : return userprizeId;
		case 1 : return wPrizeId;
		case 2 : return userid;
		case 3 : return userprizeTitle;
		case 4 : return userprizeExpirydate;
		case 5 : return userprizeNeedwealth;
		case 6 : return userprizeImgid;
		case 7 : return userprizeImgname;
		case 8 : return userprizeImgdomain;
		case 9 : return userprizeImgpath;
		case 10 : return userprizeImgsize;
		case 11 : return userprizeDuihuantime;
		case 12 : return userprizeOpptime;
		case 13 : return userprizeCategory;
		case 14 : return userprizeSfused;
		case 15 : return userprizeDetail;
 
		default:
			throw new IllegalArgumentException("PO对象中没有" + fieldName + "字段");
		}
	}
	
	@Override
	public TUserPrizePO setFieldValue(String fieldName, Object fieldValue) throws SwordBaseCheckedException {
		if (fieldValue != null && !(fieldValue instanceof BaseDataElement<?>)) {
			throw new SwordBaseCheckedException("字段值类型不是DataElelement子类型");
		}

		final Integer index = fieldIndex.get(fieldName);
		if (index == null) {
			throw new SwordBaseCheckedException("PO对象中没有" + fieldName + "字段");
		}

		switch (index) {

				case 0 : {
					if (fieldValue == null) {
						setUserprizeId(null);
					} else {
						setUserprizeId((DE_USERPRIZE_ID) fieldValue);
					}
					return this;
				}
				
				case 1 : {
					if (fieldValue == null) {
						setWPrizeId(null);
					} else {
						setWPrizeId((DE_W_PRIZE_ID) fieldValue);
					}
					return this;
				}
				
				case 2 : {
					if (fieldValue == null) {
						setUserid(null);
					} else {
						setUserid((DE_USERID) fieldValue);
					}
					return this;
				}
				
				case 3 : {
					if (fieldValue == null) {
						setUserprizeTitle(null);
					} else {
						setUserprizeTitle((DE_USERPRIZE_TITLE) fieldValue);
					}
					return this;
				}
				
				case 4 : {
					if (fieldValue == null) {
						setUserprizeExpirydate(null);
					} else {
						setUserprizeExpirydate((DE_USERPRIZE_EXPIRYDATE) fieldValue);
					}
					return this;
				}
				
				case 5 : {
					if (fieldValue == null) {
						setUserprizeNeedwealth(null);
					} else {
						setUserprizeNeedwealth((DE_USERPRIZE_NEEDWEALTH) fieldValue);
					}
					return this;
				}
				
				case 6 : {
					if (fieldValue == null) {
						setUserprizeImgid(null);
					} else {
						setUserprizeImgid((DE_USERPRIZE_IMGID) fieldValue);
					}
					return this;
				}
				
				case 7 : {
					if (fieldValue == null) {
						setUserprizeImgname(null);
					} else {
						setUserprizeImgname((DE_USERPRIZE_IMGNAME) fieldValue);
					}
					return this;
				}
				
				case 8 : {
					if (fieldValue == null) {
						setUserprizeImgdomain(null);
					} else {
						setUserprizeImgdomain((DE_USERPRIZE_IMGDOMAIN) fieldValue);
					}
					return this;
				}
				
				case 9 : {
					if (fieldValue == null) {
						setUserprizeImgpath(null);
					} else {
						setUserprizeImgpath((DE_USERPRIZE_IMGPATH) fieldValue);
					}
					return this;
				}
				
				case 10 : {
					if (fieldValue == null) {
						setUserprizeImgsize(null);
					} else {
						setUserprizeImgsize((DE_USERPRIZE_IMGSIZE) fieldValue);
					}
					return this;
				}
				
				case 11 : {
					if (fieldValue == null) {
						setUserprizeDuihuantime(null);
					} else {
						setUserprizeDuihuantime((DE_USERPRIZE_DUIHUANTIME) fieldValue);
					}
					return this;
				}
				
				case 12 : {
					if (fieldValue == null) {
						setUserprizeOpptime(null);
					} else {
						setUserprizeOpptime((DE_USERPRIZE_OPPTIME) fieldValue);
					}
					return this;
				}
				
				case 13 : {
					if (fieldValue == null) {
						setUserprizeCategory(null);
					} else {
						setUserprizeCategory((DE_USERPRIZE_CATEGORY) fieldValue);
					}
					return this;
				}
				
				case 14 : {
					if (fieldValue == null) {
						setUserprizeSfused(null);
					} else {
						setUserprizeSfused((DE_USERPRIZE_SFUSED) fieldValue);
					}
					return this;
				}
				
				case 15 : {
					if (fieldValue == null) {
						setUserprizeDetail(null);
					} else {
						setUserprizeDetail((DE_USERPRIZE_DETAIL) fieldValue);
					}
					return this;
				}
				
		default:
			throw new SwordBaseCheckedException("PO对象中没有" + fieldName + "字段");
		}
	
	}

	@Override
	protected TUserPrizePO clone() {
		TUserPrizePO t = new TUserPrizePO();
		
		t.setUserprizeId(this.userprizeId);
		t.setWPrizeId(this.wPrizeId);
		t.setUserid(this.userid);
		t.setUserprizeTitle(this.userprizeTitle);
		t.setUserprizeExpirydate(this.userprizeExpirydate);
		t.setUserprizeNeedwealth(this.userprizeNeedwealth);
		t.setUserprizeImgid(this.userprizeImgid);
		t.setUserprizeImgname(this.userprizeImgname);
		t.setUserprizeImgdomain(this.userprizeImgdomain);
		t.setUserprizeImgpath(this.userprizeImgpath);
		t.setUserprizeImgsize(this.userprizeImgsize);
		t.setUserprizeDuihuantime(this.userprizeDuihuantime);
		t.setUserprizeOpptime(this.userprizeOpptime);
		t.setUserprizeCategory(this.userprizeCategory);
		t.setUserprizeSfused(this.userprizeSfused);
		t.setUserprizeDetail(this.userprizeDetail);

		return t;
	}

	@Override
	public TUserPrizePO loadMap(Map<String, Object> dataMap) throws SwordBaseCheckedException {
		Object value = null;

		if(dataMap.containsKey("userprizeId")){
			value = dataMap.get("userprizeId");
			
			if (value == null) {
				this.setUserprizeId(null);
			} else {
				if (value instanceof DE_USERPRIZE_ID) {
					this.setUserprizeId((DE_USERPRIZE_ID) value);
				}
			    else {
					this.setUserprizeId(new DE_USERPRIZE_ID(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("wPrizeId")){
			value = dataMap.get("wPrizeId");
			
			if (value == null) {
				this.setWPrizeId(null);
			} else {
				if (value instanceof DE_W_PRIZE_ID) {
					this.setWPrizeId((DE_W_PRIZE_ID) value);
				}
			    else {
					this.setWPrizeId(new DE_W_PRIZE_ID(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("userid")){
			value = dataMap.get("userid");
			
			if (value == null) {
				this.setUserid(null);
			} else {
				if (value instanceof DE_USERID) {
					this.setUserid((DE_USERID) value);
				}
			    else {
					this.setUserid(new DE_USERID(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("userprizeTitle")){
			value = dataMap.get("userprizeTitle");
			
			if (value == null) {
				this.setUserprizeTitle(null);
			} else {
				if (value instanceof DE_USERPRIZE_TITLE) {
					this.setUserprizeTitle((DE_USERPRIZE_TITLE) value);
				}
			    else {
					this.setUserprizeTitle(new DE_USERPRIZE_TITLE(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("userprizeExpirydate")){
			value = dataMap.get("userprizeExpirydate");
			
			if (value == null) {
				this.setUserprizeExpirydate(null);
			} else {
				if (value instanceof DE_USERPRIZE_EXPIRYDATE) {
					this.setUserprizeExpirydate((DE_USERPRIZE_EXPIRYDATE) value);
				}
			    else {
					this.setUserprizeExpirydate(new DE_USERPRIZE_EXPIRYDATE(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("userprizeNeedwealth")){
			value = dataMap.get("userprizeNeedwealth");
			
			if (value == null) {
				this.setUserprizeNeedwealth(null);
			} else {
				if (value instanceof DE_USERPRIZE_NEEDWEALTH) {
					this.setUserprizeNeedwealth((DE_USERPRIZE_NEEDWEALTH) value);
				}
			    else {
					this.setUserprizeNeedwealth(new DE_USERPRIZE_NEEDWEALTH(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("userprizeImgid")){
			value = dataMap.get("userprizeImgid");
			
			if (value == null) {
				this.setUserprizeImgid(null);
			} else {
				if (value instanceof DE_USERPRIZE_IMGID) {
					this.setUserprizeImgid((DE_USERPRIZE_IMGID) value);
				}
			    else {
					this.setUserprizeImgid(new DE_USERPRIZE_IMGID(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("userprizeImgname")){
			value = dataMap.get("userprizeImgname");
			
			if (value == null) {
				this.setUserprizeImgname(null);
			} else {
				if (value instanceof DE_USERPRIZE_IMGNAME) {
					this.setUserprizeImgname((DE_USERPRIZE_IMGNAME) value);
				}
			    else {
					this.setUserprizeImgname(new DE_USERPRIZE_IMGNAME(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("userprizeImgdomain")){
			value = dataMap.get("userprizeImgdomain");
			
			if (value == null) {
				this.setUserprizeImgdomain(null);
			} else {
				if (value instanceof DE_USERPRIZE_IMGDOMAIN) {
					this.setUserprizeImgdomain((DE_USERPRIZE_IMGDOMAIN) value);
				}
			    else {
					this.setUserprizeImgdomain(new DE_USERPRIZE_IMGDOMAIN(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("userprizeImgpath")){
			value = dataMap.get("userprizeImgpath");
			
			if (value == null) {
				this.setUserprizeImgpath(null);
			} else {
				if (value instanceof DE_USERPRIZE_IMGPATH) {
					this.setUserprizeImgpath((DE_USERPRIZE_IMGPATH) value);
				}
			    else {
					this.setUserprizeImgpath(new DE_USERPRIZE_IMGPATH(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("userprizeImgsize")){
			value = dataMap.get("userprizeImgsize");
			
			if (value == null) {
				this.setUserprizeImgsize(null);
			} else {
				if (value instanceof DE_USERPRIZE_IMGSIZE) {
					this.setUserprizeImgsize((DE_USERPRIZE_IMGSIZE) value);
				}
			    else {
					this.setUserprizeImgsize(new DE_USERPRIZE_IMGSIZE(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("userprizeDuihuantime")){
			value = dataMap.get("userprizeDuihuantime");
			
			if (value == null) {
				this.setUserprizeDuihuantime(null);
			} else {
				if (value instanceof DE_USERPRIZE_DUIHUANTIME) {
					this.setUserprizeDuihuantime((DE_USERPRIZE_DUIHUANTIME) value);
				}
				else if(value instanceof java.util.Date){
					this.setUserprizeDuihuantime(new DE_USERPRIZE_DUIHUANTIME((java.util.Date)value));
				}
			    else {
					this.setUserprizeDuihuantime(new DE_USERPRIZE_DUIHUANTIME(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("userprizeOpptime")){
			value = dataMap.get("userprizeOpptime");
			
			if (value == null) {
				this.setUserprizeOpptime(null);
			} else {
				if (value instanceof DE_USERPRIZE_OPPTIME) {
					this.setUserprizeOpptime((DE_USERPRIZE_OPPTIME) value);
				}
				else if(value instanceof java.util.Date){
					this.setUserprizeOpptime(new DE_USERPRIZE_OPPTIME((java.util.Date)value));
				}
			    else {
					this.setUserprizeOpptime(new DE_USERPRIZE_OPPTIME(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("userprizeCategory")){
			value = dataMap.get("userprizeCategory");
			
			if (value == null) {
				this.setUserprizeCategory(null);
			} else {
				if (value instanceof DE_USERPRIZE_CATEGORY) {
					this.setUserprizeCategory((DE_USERPRIZE_CATEGORY) value);
				}
			    else {
					this.setUserprizeCategory(new DE_USERPRIZE_CATEGORY(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("userprizeSfused")){
			value = dataMap.get("userprizeSfused");
			
			if (value == null) {
				this.setUserprizeSfused(null);
			} else {
				if (value instanceof DE_USERPRIZE_SFUSED) {
					this.setUserprizeSfused((DE_USERPRIZE_SFUSED) value);
				}
			    else {
					this.setUserprizeSfused(new DE_USERPRIZE_SFUSED(value.toString()));
				}
			}
		}

		if(dataMap.containsKey("userprizeDetail")){
			value = dataMap.get("userprizeDetail");
			
			if (value == null) {
				this.setUserprizeDetail(null);
			} else {
				if (value instanceof DE_USERPRIZE_DETAIL) {
					this.setUserprizeDetail((DE_USERPRIZE_DETAIL) value);
				}
			    else {
					this.setUserprizeDetail(new DE_USERPRIZE_DETAIL(value.toString()));
				}
			}
		}

		return this;
	}
	
	@Override
	public Map<String,Object> toMap() {
		Map<String,Object> dataMap = new HashMap<String,Object>();

		dataMap.put("userprizeId", userprizeId);
		dataMap.put("wPrizeId", wPrizeId);
		dataMap.put("userid", userid);
		dataMap.put("userprizeTitle", userprizeTitle);
		dataMap.put("userprizeExpirydate", userprizeExpirydate);
		dataMap.put("userprizeNeedwealth", userprizeNeedwealth);
		dataMap.put("userprizeImgid", userprizeImgid);
		dataMap.put("userprizeImgname", userprizeImgname);
		dataMap.put("userprizeImgdomain", userprizeImgdomain);
		dataMap.put("userprizeImgpath", userprizeImgpath);
		dataMap.put("userprizeImgsize", userprizeImgsize);
		dataMap.put("userprizeDuihuantime", userprizeDuihuantime);
		dataMap.put("userprizeOpptime", userprizeOpptime);
		dataMap.put("userprizeCategory", userprizeCategory);
		dataMap.put("userprizeSfused", userprizeSfused);
		dataMap.put("userprizeDetail", userprizeDetail);
		
		return dataMap;
	}
	
	@Override
	public Map<String,Object> toMapWithDEValue() {
		Map<String,Object> dataMap = new HashMap<String,Object>();

		dataMap.put("userprizeId", (userprizeId==null?null:userprizeId.value));
		dataMap.put("wPrizeId", (wPrizeId==null?null:wPrizeId.value));
		dataMap.put("userid", (userid==null?null:userid.value));
		dataMap.put("userprizeTitle", (userprizeTitle==null?null:userprizeTitle.value));
		dataMap.put("userprizeExpirydate", (userprizeExpirydate==null?null:userprizeExpirydate.value));
		dataMap.put("userprizeNeedwealth", (userprizeNeedwealth==null?null:userprizeNeedwealth.value));
		dataMap.put("userprizeImgid", (userprizeImgid==null?null:userprizeImgid.value));
		dataMap.put("userprizeImgname", (userprizeImgname==null?null:userprizeImgname.value));
		dataMap.put("userprizeImgdomain", (userprizeImgdomain==null?null:userprizeImgdomain.value));
		dataMap.put("userprizeImgpath", (userprizeImgpath==null?null:userprizeImgpath.value));
		dataMap.put("userprizeImgsize", (userprizeImgsize==null?null:userprizeImgsize.value));
		dataMap.put("userprizeDuihuantime", (userprizeDuihuantime==null?null:userprizeDuihuantime.value));
		dataMap.put("userprizeOpptime", (userprizeOpptime==null?null:userprizeOpptime.value));
		dataMap.put("userprizeCategory", (userprizeCategory==null?null:userprizeCategory.value));
		dataMap.put("userprizeSfused", (userprizeSfused==null?null:userprizeSfused.value));
		dataMap.put("userprizeDetail", (userprizeDetail==null?null:userprizeDetail.value));
		
		return dataMap;
	}
	
	@Override
	public TUserPrizePO newInstance() {
		return new TUserPrizePO();
	}
	
	@Override
	public String getTableName(){
		return TABLE_NAME;
	}
	
	@Override
	public BaseDataElement<?>[] getPrimaryKey() {
		return new BaseDataElement<?>[]{userprizeId};
	}

	@Override
	public void checkNotNull(byte sqlType) throws SwordBaseCheckedException {
		StringBuilder errorMsg = new StringBuilder();
		// insert
		if (sqlType == 0) {
				//只校验不可为空但又没有默认值的字段
				if (userprizeId.value == null && !HAS_DEFAULT_VALUE.get(0)) {
					errorMsg.append("字段userprizeId不允许为空\n");
				}
				if (userid.value == null && !HAS_DEFAULT_VALUE.get(2)) {
					errorMsg.append("字段userid不允许为空\n");
				}
				if (userprizeCategory.value == null && !HAS_DEFAULT_VALUE.get(13)) {
					errorMsg.append("字段userprizeCategory不允许为空\n");
				}

		}
		// update
		else if (sqlType == 1) {
		if (updateState.get(0) && userprizeId.value == null) {
			errorMsg.append("字段userprizeId不允许为空\n");
		}
		if (updateState.get(2) && userid.value == null) {
			errorMsg.append("字段userid不允许为空\n");
		}
		if (updateState.get(13) && userprizeCategory.value == null) {
			errorMsg.append("字段userprizeCategory不允许为空\n");
		}

		}
		
		if (errorMsg.length() > 0) {
			errorMsg.setLength(errorMsg.length() - 1);
			throw new SwordBaseCheckedException(errorMsg.toString());
		}
	}

	@Override
	public void updateLrrq(DateDE lrrq) {
	}

	@Override
	public void updateXgrq(DateDE xgrq) {
	}

	@Override
	public String toString() {
		StringBuilder str = new StringBuilder();
		str.append("userprizeId:").append(userprizeId.value!=null?userprizeId:"").append(" ").append("wPrizeId:").append(wPrizeId.value!=null?wPrizeId:"").append(" ").append("userid:").append(userid.value!=null?userid:"").append(" ").append("userprizeTitle:").append(userprizeTitle.value!=null?userprizeTitle:"").append(" ").append("userprizeExpirydate:").append(userprizeExpirydate.value!=null?userprizeExpirydate:"").append(" ").append("userprizeNeedwealth:").append(userprizeNeedwealth.value!=null?userprizeNeedwealth:"").append(" ").append("userprizeImgid:").append(userprizeImgid.value!=null?userprizeImgid:"").append(" ").append("userprizeImgname:").append(userprizeImgname.value!=null?userprizeImgname:"").append(" ").append("userprizeImgdomain:").append(userprizeImgdomain.value!=null?userprizeImgdomain:"").append(" ").append("userprizeImgpath:").append(userprizeImgpath.value!=null?userprizeImgpath:"").append(" ").append("userprizeImgsize:").append(userprizeImgsize.value!=null?userprizeImgsize:"").append(" ").append("userprizeDuihuantime:").append(userprizeDuihuantime.value!=null?userprizeDuihuantime:"").append(" ").append("userprizeOpptime:").append(userprizeOpptime.value!=null?userprizeOpptime:"").append(" ").append("userprizeCategory:").append(userprizeCategory.value!=null?userprizeCategory:"").append(" ").append("userprizeSfused:").append(userprizeSfused.value!=null?userprizeSfused:"").append(" ").append("userprizeDetail:").append(userprizeDetail.value!=null?userprizeDetail:"").append(" ");
		return str.toString();
	}
	
}
